import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { CardOrderLogisticsVO, CardOrderLogisticsForm, CardOrderLogisticsQuery } from '@/api/system/cardOrderLogistics/types';

/**
 * 查询球星卡订单列表
 * @param query
 * @returns {*}
 */

export const listCardOrderLogistics = (query?: CardOrderLogisticsQuery): AxiosPromise<CardOrderLogisticsVO[]> => {
  return request({
    url: '/system/cardOrderLogistics/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询球星卡订单详细
 * @param id
 */
export const getCardOrderLogistics = (id: string | number): AxiosPromise<CardOrderLogisticsVO> => {
  return request({
    url: '/system/cardOrderLogistics/' + id,
    method: 'get'
  });
};

/**
 * 新增球星卡订单
 * @param data
 */
export const addCardOrderLogistics = (data: CardOrderLogisticsForm) => {
  return request({
    url: '/system/cardOrderLogistics',
    method: 'post',
    data: data
  });
};

/**
 * 修改球星卡订单
 * @param data
 */
export const updateCardOrderLogistics = (data: CardOrderLogisticsForm) => {
  return request({
    url: '/system/cardOrderLogistics',
    method: 'put',
    data: data
  });
};

/**
 * 删除球星卡订单
 * @param id
 */
export const delCardOrderLogistics = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/cardOrderLogistics/' + id,
    method: 'delete'
  });
};

/**
 * 查询物流公司列表
 */
export const queryExpressageInfoList = () => {
  return request({
    url: '/system/cardOrderLogistics/queryExpressageInfoList',
    method: 'get'
  });
};
